package com.mkh.st.common.core.constant.enums;

import lombok.AllArgsConstructor;
import lombok.Getter;

import java.util.Objects;

@Getter
@AllArgsConstructor
public enum MenuButtomEnum {
	/**
	 * 按钮
	 */
	BUTTOM(1, "按钮"),

	/**
	 * 菜单
	 */
	MENU(0, "菜单");

	/**
	 * 类型
	 */
	private Integer code;

	/**
	 * 描述
	 */
	private String description;

	public static MenuButtomEnum get(Integer code){
		if (Objects.isNull(code)) {
			return null;
		}
		for (MenuButtomEnum menuButtomEnum : MenuButtomEnum.values()){
			if (code.equals(menuButtomEnum.code))  return menuButtomEnum;
		}
		return null;
	}
}
